<div class="order customer-order-list">
    <!--begin map-->
    <div class="map">
        <a class="index" href="/index">首页</a>&nbsp;&gt;&nbsp;<a href="/index/goods/order.html">订单</a>
    </div>
    <!--end map-->
    <ul class="ui-tab-menu">
        <li class="current"><a code="WBO_ORDER_INDENT" class="menu2" href="/old/order/order?action=list&amp;pageSize=10">订货单</a></li>
        <li><a code="WBO_ORDER_RETURNED" class="menu2" href="/old/order/returnOrder?action=list&amp;pageSize=10">退货单</a></li>
        <li><a code="WBO_ORDER_STATISTICS" class="menu2" href="/order/orderStatistics.jsp">订单统计</a></li>
        <li><a code="WBO_ORDER_SEND_STATISTICS" class="menu2" href="/old/order/logisticsReconciliation?action=list">发货统计</a></li>
    </ul>
    <script>
      function filterOrderByStatus(a) {
        $("#searchType").val(1), $("#order_status").val(a), $("#myForm").submit()
      }
    </script>
    <div class="main-t">
        <form action="/old/order/order" method="get" id="myForm" autocomplete="off">
            <div class="func clearfix">
                <div class="control-filter">筛选：
                    <span id="order-filter-time" class="table-filter">全部订单</span>
                    <div class="target_box shadow" id="order-filter-time-box" style="display: none;position: absolute; left: 185.75px; top: 215px; z-index: 999; display: none;">
                        <ul>
                            <li><a href="javascript:void(0);" onclick="filterOrderByStatus()" class="selected">全部订单</a></li>
                            <li><a href="javascript:void(0);" onclick="filterOrderByStatus(-2)">待处理订单</a></li>
                            <li><a href="javascript:void(0);" onclick="filterOrderByStatus(6)">已完成订单</a></li>
                            <li><a href="javascript:void(0);" onclick="filterOrderByStatus(-1)">已作废订单</a></li>
                        </ul>
                    </div>
                </div>
            </div>
        </form>
        <div class="table-wrap">
            <table class="fitTable">
                <thead>
                    <tr class="">
                        <th class="tl"  style="width: 484px;">单号</th>
                        <th class="tr"  style="width: 110px;">制单人</th>
                        <th class="tc"  style="width: 110px;">收货地址</th>
                        <th class="tc"  style="width: 120px;">出库/发货</th>
                        <th class="tc"  style="width: 110px;">审核状态</th>
                        <th class="tc"  style="width: 110px;">操作</th>
                    </tr>
                </thead>
                <tbody>
                {foreach name="$result.rows" item="vo"}
                <tr class="">
                    <td class="order-num">
                        <a href="{:url('/index/goods/orderInfo',array('ids'=>$vo.id))}" class="dib vt">{$vo.nb}</a>
                        <span class="lite-gray">{:date('Y-m-d H:i:s',$vo.createtime)}</span>
                    </td>
                    <td class="creat-name tr">
                        <span>杨柳</span>
                    </td>
                    <td class="order-address tc">
                        <span>杨柳</span>
                        <span class="address-tip-1 order-address-trace" data-addressId="{$vo.id}">
                            <em class="address-icon"></em>
                            <span class="address-text">地址</span>
                            <em class="ui-arrow-icon"></em>
                            <div class="hidden">
                                <span class="address-{$vo.id}">
                                    仓&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;库：{$vo.githouse.gname}<br>
                                    收货地址：{$vo.githouse.province_text}{$vo.githouse.city_text}{$vo.githouse.area_text}{$vo.githouse.address} <br>
                                    联系方式：{$vo.githouse.mobile}
                                </span>
                            </div>
                        </span>
                    </td>
                    <td class="tc order-logistics-status">
                        <span>已出库/已发货</span>
                    </td>
                    <td class="order-status tc">
                        <span class="">已完成</span>
                        <span class="order-status-trace status-tip-1" data-track="{$vo.id}">
                            <em class="order-status-icon"></em>
                            <span class="order-status-text">跟踪</span>
                            <em class="ui-arrow-icon"></em>
                        </span>
                        <div class="hidden">
                            <span class="track-{$vo.id}">
                                    <table>
                                        <thead>
                                            <tr>
                                                <th>处理时间</th>
                                                <th>操作人</th>
                                                <th>处理信息</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                        {foreach name="$vo.orderlog" item="log"}
                                            <tr>
                                                <td> {:date('Y-m-d H:i:s',$log.updatetime)} </td>
                                                <td> {$log.username} </td>
                                                <td> {$log.content} </td>
                                            </tr>
                                        {/foreach}
                                        </tbody>
                                    </table>
                            </span>
                        </div>
                    </td>
                    <td class="order-op tc">
                        <a href="{:url('/index/goods/orderInfo',array('ids'=>$vo.id))}" class="theme-color" title="订单详情">订单详情</a>
                    </td>
                </tr>
                {/foreach}

                </tbody>
                <tfoot>
                <tr class="">
                    <td class="tr pr10" colspan="8">
                        <div class="page">
                            <span>每页显示</span>
                            <select class="select_page pageSel" id="select_page" onchange="selectPage()">
                                <option {$where.pageSize == 10 ? 'selected="selected"' : ''} value="10">10</option>
                                <option {$where.pageSize == 30 ? 'selected="selected"' : ''} value="30">30</option>
                                <option {$where.pageSize == 50 ? 'selected="selected"' : ''} value="50">50</option>
                            </select>
                            <span>条</span>
                            <div class="page-number">
                                <span>第</span>
                                <input class="ui-pager-inp" type="text" value="{$where.currentPage}" onkeyup="inputPage(this);" onblur="inputPageBlur(this);" autocomplete="off">
                                <span>页</span>
                                <span>共</span>
                                <span class="totalPage">{:ceil($result.total / $where.pageSize)}</span>
                                <span>页</span>
                                <div class="pn">
                                    <a href="javascript:void(0);" onclick="goPage({$where.currentPage - 1})" class="ui-pager-prev">上一页</a><a href="javascript:void(0);" onclick="goPage({$where.currentPage + 1})" class="ui-pager-next">下一页</a>
                                </div>
                            </div>
                        </div>

                        <span class="page-total">共计：{$result.total}条</span>
                        <script type="text/javascript">
                          function goPage(page) {
                            if(page <= 0){
                              layer.msg('已经是第一页了！');
                              return false;
                            }
                            if(page > parseInt($(".totalPage").text()))
                            {
                              layer.msg('已经是最后一页了！');
                              return false;
                            }
                            var pageSize = '{$where.pageSize}';
                            window.location.href='/index/goods/order?currentPage='+page+'&pageSize='+pageSize;
                          }
                          function inputPage(obj) {
                            var event = window.event || arguments.callee.caller.arguments[0];
                            if (event.keyCode == 13)
                            {
                              var page = parseInt(obj.value);
                              if(isNaN(page)) page=1;
                              if(page > parseInt($(".totalPage").text())) page = $(".totalPage").text();
                              goPage(page);
                            }
                          }
                          function inputPageBlur(obj){
                            var page = parseInt(obj.value);
                            if(isNaN(page)) page=1;
                            if(page > parseInt($(".totalPage").text())) page = $(".totalPage").text();
                            goPage(page);
                          }
                          function selectPage() {
                            var pageSize = $("#select_page").val();
                            if(arguments.length != 0){
                              pageSize = arguments[0];
                            }
                            var currentPage = 1;
                            var totalCount = '{$result.total}';
                            currentPage = currentPage==0 ? 1 : currentPage;
                            totalCount = totalCount==0 ? 1 : totalCount;
                            var totalPage = Math.ceil(totalCount/pageSize);
                            if(currentPage<1) currentPage=1;
                            if(currentPage>totalPage) currentPage=totalPage;
                            window.location.href='/index/goods/order?currentPage='+currentPage+'&pageSize='+pageSize;
                          }
                        </script>
                    </td>
                </tr>
                </tfoot>
            </table>
        </div>
    </div>
</div>
<script>
    $(function () {
      $('#order-filter-time').mousemove(function () {
        $('#order-filter-time-box').css('display','block');
      });
      $('#order-filter-time-box').mousemove(function () {
        $('#order-filter-time-box').css('display','block');
      }).mouseout(function (){
        $('#order-filter-time-box').css('display','none');
      });
      //显示地址信息
      $(".order-address-trace").hover(function(){
        layer.tips($('.address-'+$(this).attr('data-addressId')).html(), $(this).find('.ui-arrow-icon'), {
          tips: [3, '#3595CC'],
          time: 100000000,
          maxWidth:500
        });
      },function(){
        layer.tips($('.address-'+$(this).attr('data-addressId')).html(), $(this).find('.ui-arrow-icon'), {
          tips: [3, '#3595CC'],
          time: 1,
          maxWidth:500
        });
      });
      //审核状态  显示审核状态
      $('.order-status-trace').hover(function () {
        layer.tips($('.track-'+$(this).attr('data-track')).html(), $(this).find('.ui-arrow-icon'), {
          tips: [3, '#3595CC'],
          time: 100000000,
          maxWidth:500
        });
      },function () {
        layer.tips($('.track-'+$(this).attr('data-track')).html(), $(this).find('.ui-arrow-icon'), {
          tips: [3, '#3595CC'],
          time: 1,
          maxWidth:500
        });
      });

    });
</script>